<%@page contentType="text/html; charset=utf-8" %>
<%@ include file="/commons/taglibs.jsp"%>
<%@ include file="/commons/messages.jsp"%>
<%@ include file="/commons/commonEdit.jsp" %>
<%@ include file="/commons/validation.jsp" %>
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8">
<script type="text/javascript" src="${ctx}/scripts/div/common.js"></script>
<script language="JavaScript" type="text/javascript" src="${ctx}/scripts/public3.js"></script>
<script language="JavaScript" type="text/javascript" src="${ctx}/scripts/ajaxException.js"></script>
<script language="JavaScript" type="text/javascript" src="${ctx}/pages/com/ce/pms/occupation/occupation.js"></script>
<script type="text/javascript">
var submitFormName="ownerForm";
function next(url){
	window.location.href = url;
}
function radioClickHandle(tableid,displayable){
	display(tableid,displayable);
}
function editIdentity(){
	var isTrue=$(submitFormName).fireEvent("onSubmit") ;
    if(isTrue){
       if(submitFormName == "ownerForm"){
       		$(submitFormName).clientName.value=getClientName();
       }else{
       		$(submitFormName).clientName.value=$F('consignAgentName');
       }
       var param = Form.serialize(submitFormName);
       param = param+"&keyword="+$F('keyword')+"&houseId="+$F('houseId')+"&houseNumber="+$F('houseNumber');
       var url = "${ctx}/occupation_joinHandleAction.do?method=editIdentityValidate";
       new Ajax.Request(url,{method: 'post',parameters :param ,onSuccess : showResult});
	}
}
function showResult(response){
	 ajaxSubmitException(response.responseText);
	var obj=findFrame('identityMain');
	obj.reloadIdentity();
	windowClose();
}
function setFlag(flagVar){
	submitFormName = flagVar;
}
function setConsignTypeName(thiz){
	var index = thiz.selectedIndex;
	$('consignAgentIdTypeName').value = thiz.options[index].text;
}
function init(){
	if('${identityValidate.transactJoinIdentity}' == "002"){
		radioClickHandle('table02','show');
		radioClickHandle('table01','hidden');
		setFlag('consignForm');
		var objs = document.getElementsByName('transactJoinIdentity');
		for(var i = 0 ; i < objs.length;i++){
			if(objs[i].value == "002"){
		       objs[i].checked = true;
		       break;
		    }
		}
	}
	var str = "${identityValidate.clientName}";
	var propertyType=document.getElementsByName("cName");
	if(propertyType != null){
	  	for (var   i=0;   i<propertyType.length;   i++){
	          if(str.indexOf(propertyType[i].value,0)>-1){
	           	propertyType[i].checked = true;
	          }
	    }
    }
    if('${identityValidate.joinMode}'=="002"){
    	$('joinMode').checked = true;
    }
}
</script>
</head>
<body onload="init()">
<table width="100%" border="0" cellpadding="0" cellspacing="0">
  <tr>
    <td class="window_head_outBg"><table border="0" cellpadding="0" cellspacing="0">
      <tr>
        <td><img src="${ctx}/images/ico_Advance.gif" width="16" height="16" align="absmiddle" /> <span class="window_head_intext">身份验证修改</span></td>
        </tr>
    </table></td>
  </tr>
  <tr>
    <td class="aux_header_line_1"></td>
  </tr>
  <tr>
    <td class="aux_header_line_2"></td>
  </tr>
  <tr>
    <td valign="middle" class="content"><table width="100%" border="0" cellpadding="0" cellspacing="0" class="container_in_show">
      <tr>
        <td valign="top">
            <div id="tab_Search">
              <table width="100%" border="0" cellpadding="0" cellspacing="0">
                <tr>
                  <td valign="top"><table width="100%" border="0" cellpadding="0" cellspacing="0" id="tab_subMenu1">
                      <tr>
                        <td>
						<div style="height:360px;overflow:auto">
						<input type="hidden" name="houseId" value="${identityValidate.houseId }">
						<input type="hidden" name="houseNumber" value="${identityValidate.houseNumber }">
						<input type="hidden" name="keyword" value="${identityValidate.keyword }">
						<table width="100%" border="0" align="center" cellpadding="5" cellspacing="0">
                            <tr>
                              <td><table width="100%" border="0" cellpadding="0" cellspacing="1" class="aux_intable_color" >
                                  <tr>
                                    <td valign="top" class="aux_intable_td1">房 号：</td>
                                    <td valign="top" class="aux_intable_td2">${identityValidate.houseNumber }</td>
                                  </tr>
								  <tr>
									<td valign="top" class="aux_intable_td1">业 主： </td>
			 						<td valign="middle" class="aux_intable_td2">
			 						 <c:forEach items="${selfClientSet}" var="clientSelf">
			 						  ${clientSelf.realHouseClientInfo }<br>
			 						 </c:forEach>
			 						</td>
								  </tr>
								  <tr>
                                    <td colspan="2" class="aux_titletable">管理房号:${coalitionHouseNumber }
                                      <input name="joinMode" type="checkbox" readonly="readonly" value="002" disabled="disabled">
                                      <span style="font-weight:normal"> 按管理房办理</span></td>
							      </tr>
							      <c:if test="${empty clientInfoSet}">
								  		  </tr>
										    <td valign="top" class="aux_intable_td1">相关房号：</td>
					                        <td valign="top" class="aux_intable_td2">&nbsp;</td>
										 </tr>
										<tr>
											<td valign="top" class="aux_intable_td1">业 主： </td>
											<td valign="top" class="aux_intable_td2">&nbsp;</td>
										</tr>
								  </c:if>
								  <c:forEach items="${clientInfoSet}" var="client">
							             </tr>
										    <td valign="top" class="aux_intable_td1">相关房号：</td>
					                        <td valign="top" class="aux_intable_td2">${client.realHouseNumber }</td>
										 </tr>
										<tr>
											<td valign="top" class="aux_intable_td1">业 主： </td>
											<td valign="top" class="aux_intable_td2">${client.realHouseClientInfo }</td>
										</tr>
							     </c:forEach>
								 <tr>
                                    <td class="aux_titletable">入伙人信息：&nbsp;　&nbsp;　&nbsp;　&nbsp;　                                      </td>
                                    <td class="aux_intable_require">&nbsp;<input name="transactJoinIdentity" type="radio" value="001" checked="checked"   onClick="radioClickHandle('table01','show');radioClickHandle('table02','hidden');setFlag('ownerForm')" />
                                      业 主&nbsp;　&nbsp;　&nbsp;　&nbsp;　&nbsp;　
                                      <input type="radio" name="transactJoinIdentity" value="002" onClick="radioClickHandle('table02','show');radioClickHandle('table01','hidden');setFlag('consignForm')" />
                                      委托代理人</td>
								  </tr>
                                  </table>
                                  <form action="" name="ownerForm" method="post" class="required-validate">
                                  <input type="hidden" name="transactJoinIdentity" value="001">
                                  <input type="hidden" name="clientName" value="">
                                  <table width="100%" border="0" cellpadding="0" cellspacing="1" class="aux_intable_color" id="table01" style="display:show">
                                    <tr>
                                      <td class="aux_intable_td1">业主姓名：</td>
                                      <td class="aux_intable_require" id="clientId">
                                       <c:forEach items="${clientInfoList}" var="client" varStatus="status">
							              <input type="checkbox" name="cName" value="${client.participantName}" class="validate-one-required">
							              ${client.participantName} &nbsp;&nbsp;&nbsp;
							            </c:forEach>
                                      </td>
                                    </tr>
                                    <tr>
                                      <td valign="top" class="aux_intable_td1">备 注：</td>
                                      <td class="aux_intable_td2"><textarea name="description" id="desr1" cols="29" rows="3" class="max-length-200">${identityValidate.description }</textarea></td>
                                    </tr>
                                  </table>
                                  </form>
                                  <form action="" name="consignForm" method="post" class="required-validate">
                                  <input type="hidden" name="transactJoinIdentity" value="002">
                                  <input type="hidden" name="clientName" value="">
                                   <input type="hidden" name="consignAgentIdTypeName" value="${identityValidate.consignAgentIdTypeName }">
                                  <input type="hidden" name="consignAgentId" value="${identityValidate.consignAgentId }">
                                  <table width="100%" border="0" cellpadding="0" cellspacing="1" class="aux_intable_color" id="table02" style="display:none">
                                    <tr>
                                      <td class="aux_intable_td1">委托代理人姓名：</td>
                                      <td class="aux_intable_require"><input name="consignAgentName" type="text" value="${identityValidate.consignAgentName }" class="required validate-char" size="16" maxlength="36"/>                                      </td>
                                    </tr>
                                    <tr>
                                      <td class="aux_intable_td1">证件类型：</td>
                                      <td class="aux_intable_require">
                                        <pms:unitedSelect id="orgcertificateType"
										name="consignAgentIdTypeId" dataList="${certificateTypeList}" selectText="请选择..."
								 		optionLabel="idTypeName"
								 		onChange="setConsignTypeName(this)"
								 		value="${identityValidate.consignAgentIdTypeId}"
								 		className="select-one-required"
										optionValue="idTypeId">
									  </pms:unitedSelect>                                         </td>
                                    </tr>
                                    <tr>
                                      <td valign="top" class="aux_intable_td1">证件号码：</td>
                                      <td class="aux_intable_require">
                                        <input name="consignAgentIdNumber" type="text" class="required validate-char" size="16" maxlength="30" value="${identityValidate.consignAgentIdNumber }" />
                                      </td>
                                    </tr>
                                    <tr>
                                      <td valign="top" class="aux_intable_td1">联系电话：</td>
                                      <td class="aux_intable_td2"><table border="0" cellspacing="0" cellpadding="0">
                                        <tr>
                                          <td><input name="consignAgentLinkmanPhone" type="text" class="validate-char" size="16" maxlength="30" value="${identityValidate.consignAgentLinkmanPhone }"/></td>
                                          <td width="4">&nbsp;</td>
                                          <td>&nbsp;</td>
                                        </tr>
                                      </table></td>
                                    </tr>
                                    <tr>
                                      <td valign="top" class="aux_intable_td1">备 注：</td>
                                      <td class="aux_intable_td2"><textarea name="description" id="desr2" cols="29" rows="2" class="max-length-200">${identityValidate.description }</textarea></td>
                                    </tr>
                                 </table>
                                 </form>
                                </td>
                            </tr>
                        </table>
						</div>
						</td>
                      </tr>
                  </table></td>
                </tr>
              </table>
            </div></td>
        </tr>
       </table></td>
  </tr>

<tr>
    <td class="window_footer"><table border="0" cellpadding="0" cellspacing="0">
        <tr>
          <td>&nbsp;</td>
          <td class="btn_between_space"></td>
          <td><table border="0" cellpadding="0" cellspacing="0" onclick="editIdentity()">
            <tr>
              <td class="buttonOffLeft" id="btn1_51"></td>
              <td class="buttonOffMiddle" id="btn1_52" onblur="btn_change(5)" onMouseOver="btn_change_over(5)" onMouseOut="btn_change_out(5)" onClick="closewin();"><img src="${ctx}/images/ico_ok.gif" border="0" align="absmiddle" /> 保 存</td>
              <td class="buttonOffRight" id="btn1_53"></td>
            </tr>
        </table></td>
        <td class="btn_between_space"></td>
        <td><table border="0" cellpadding="0" cellspacing="0" onClick="windowClose();">
            <tr>
              <td class="buttonOffLeft" id="btn1_31"></td>
              <td class="buttonOffMiddle" id="btn1_32" onblur="btn_change(3)" onMouseOver="btn_change_over(3)" onMouseOut="btn_change_out(3)"><img src="${ctx}/images/ico_cancel.gif" border="0" align="absmiddle" /> 关 闭</td>
              <td class="buttonOffRight" id="btn1_33"></td>
            </tr>
        </table></td>
      </tr>
    </table>
	</td>
</tr>
</table>
</body>
</html>